using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sec_scan漏洞扫描系统
{
    public partial class Sec_Scan_Scan : Form
    {
        //定义委托
        public delegate void MyDelegate();
        //定义事件
        public event MyDelegate MyEvent;
        public string A1;
        public Sec_Scan_Scan()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("测试地址不能为空！");
                return;
            }
            else
            {

            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("扫描地址不能为空！");
                return;
            }
            else
            {
                //获取扫描地址后进行传出
                string url = textBox1.Text;
                Sec_Api.Sec_LoopScan_Service_Api.Url = url;//漏洞扫描地址
                //Sec_Service.Sec_LoopScan_Service.LoopScanInfo(Sec_Api.Sec_LoopScan_Service_Api.P1);//执行漏洞扫描
                //保存扫描信息

                //执行完成后 执行关闭事件
                if (MyEvent != null)
                    MyEvent();
                this.Close();
            }
        }
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
